package com.common.security.abstracts;

import com.common.security.interfaces.ISecurity;

/**
 * The extension of the AbstractException as an unchecked RuntimeException.
 * It has the same error code range as it's twin class.
 * 
 * @author Ady
 *
 */
public class AbstractRuntimeException extends RuntimeException implements ISecurity {
	private static final long serialVersionUID = 1L;

	public static final int ERROR_NOT_FOUND = 1001;
	protected static final String MESSAGE_ERROR_NOT_FOUND = "Error not found";
	
	private int code;
	
	public AbstractRuntimeException(int code, String message) {
		super(message);
		this.code = code;
	}
	
	@Override
	public int getCode() {
		return code;
	}

	@Override
	public void setCode(int code) {
		this.code = code;
	}

}
